package com.sky.api.client.fallback;

import com.sky.api.client.ItemClient;
import com.sky.result.Result;
import com.sky.vo.DishVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;


@Slf4j
public class ItemClientFallbackFactory implements FallbackFactory<ItemClient> {

    @Override
    public ItemClient create(Throwable cause) {
        return new ItemClient() {
            @Override
            public Result<DishVO> getById(Long id) {
                log.info("查询菜品失败");
                return Result.error("查询菜品失败");
            }
        };
    }
}
